package flyweight;

import java.sql.Connection;

public class Test {
    public static void main(String[] args) {
        ConnectionPool connectionPool=new ConnectionPool();
        Connection connection= connectionPool.getConnection();
        connectionPool.release(connection);
        String s1="hello";
        String s2="hello";
        String s3="he"+"llo";
        String s4=new String("hello");
        System.out.println(s1==s3);
        System.out.println(s1==s4);
        String s5=s4.intern();
        System.out.println(s1==s5);
        String s7="h";
        String s8="ello";
        String s9=s7+s8;
        System.out.println(s9.intern());
        System.out.println(s1==s9);
        Integer a=Integer.valueOf(1000);
        Integer b=1000;
        System.out.println(a.equals(b));
    }
}
